package com.itcast.Web;

import com.itcast.Service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForDiSet {
    public static void main(String[] args) {

//        PublicDao publicDao = PublicFactory.getPublicDao();
//        publicDao.save();
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//        PublicDao publicDao = (PublicDao) ctx.getBean("publicDao");
//        publicDao.save();
UserService userService = (UserService) ctx.getBean("userService");
    userService.save();
    }
}
